#include "PasswordForm.hpp"

PasswordForm::PasswordForm()/*{{{*/
{
  this->localPassEdit = new QLineEdit(this);
  localPassEdit->setEchoMode(QLineEdit::Password);
  this->remotePassEdit = new QLineEdit(this);
  remotePassEdit->setEchoMode(QLineEdit::Password);
  QPushButton *okBtn = new QPushButton("OK", this);
  QPushButton *cancelBtn = new QPushButton("Cancel", this);
  QLabel *localLbl = new QLabel("Local DB password:", this);
  QLabel *remoteLbl = new QLabel("Remote DB password:", this);
  QLayout *lay = new QVBoxLayout();
  QLayout *btnLay = new QHBoxLayout();


  connect(okBtn, SIGNAL(clicked()),
          this, SLOT(accept()));
  connect(cancelBtn, SIGNAL(clicked()),
          this, SLOT(reject()));

  lay->addWidget(localLbl);
  lay->addWidget(localPassEdit);
  lay->addWidget(remoteLbl);
  lay->addWidget(remotePassEdit);
  btnLay->addWidget(okBtn);
  btnLay->addWidget(cancelBtn);
  lay->addItem(btnLay);

  this->setLayout(lay);
}/*}}}*/

PasswordForm::~PasswordForm()/*{{{*/
{
}/*}}}*/

void PasswordForm::accept()/*{{{*/
{
  this->localPass = this->localPassEdit->text();
  this->remotePass = this->remotePassEdit->text();
  QDialog::accept();
}/*}}}*/

QString PasswordForm::getLocalPassword()/*{{{*/
{
  return this->localPass;
}/*}}}*/

QString PasswordForm::getRemotePassword()/*{{{*/
{
  return this->remotePass;
}/*}}}*/
